const path = require("path");
const math = require("remark-math");
const katex = require("rehype-katex");

module.exports = {
  title: "灵知 全栈工程师",
  titleDelimiter: "-",
  url: "https://1xtt.com",
  baseUrl: "/",
  favicon: "img/favicon.ico",
  organizationName: "1xtt.com",
  projectName: "1xtt.com",
  themeConfig: {
    hideableSidebar: true,
    navbar: {
      title: "灵知",
      logo: {
        alt: "灵知",
        src: "img/user.jpg",
        srcDark: "img/user.jpg",
      },
      items: [
        {
          type: "localeDropdown",
          position: "left",
        },
        {
          to: "/",
          label: "博客",
          position: "right",
          items: [
            {
              label: "前端",
              to: "tags/前端",
            },
            {
              label: "职业",
              to: "tags/职业",
            },
            {
              label: "健康",
              to: "tags/健康",
            },
          ],
        },
        {
          label: "视频",
          position: "right",
          to: "docs/videos/videos-intro",
        },
        {
          label: "课程",
          position: "right",
          items: [
            {
              label: "React 即时通信 UI 开发实战",
              to: "docs/course/react-chat-ui/react-chat-ui",
            },
          ],
        },
        {
          label: "教程",
          position: "right",
          items: [
            {
              label: "CSS",
              to: "docs/css/box-model/box-model",
            },
          ],
        },
        {
          label: "资源导航",
          position: "right",
          to: "docs/resources/resources-intro",
        },
        {
          href: "https://gitee.com/etal/blog",
          label: "Gitee",
          position: "right",
        },
      ],
    },
    algolia: {
      apiKey: "fabfb0e9997e101154ed85d64b7b6a3c",
      indexName: "ZXUQIANCN",
      appId: "LIJMO3C9C4",
    },
    footer: {
      style: "dark",
      links: [
        {
          title: "Social",
          items: [
            {
              label: "博客",
              to: "/",
            },
            {
              label: "Gitee",
              href: "https://gitee.com/etal/blog",
            },
          ],
        },
        {
          title: "前端 常用链接",
          items: [
            {
              label: "MDN",
              to: "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript",
            },
            {
              label: "Vue3 文档",
              to: "https://v3.cn.vuejs.org/"
            },
            {
              label: "windicss",
              to: "https://windicss.org/"
            },
            {
              label: "移动端 uniapp",
              to: "https://uniapp.dcloud.io/",
            },
            {
              label: "后台解决方案 Vue",
              to: "https://vvbin.cn/doc-next/",
            },
          ],
        },
        {
          title: "后端 常用链接",
          items: [
            {
              label: "thinkphp6",
              to: "https://www.kancloud.cn/manual/thinkphp6_0",
            },
          ],
        },
      ],
      copyright: `Copyright © ${new Date().getFullYear()} 灵知 (吴显天) Built with Docusaurus.<p><a href='http://beian.miit.gov.cn/'>京ICP备18036965号</a></p>本站所有内容遵循 <a rel='license' href='https://creativecommons.org/licenses/by-nc/4.0/deed.zh-Hans' style='color: hsl(210deg, 100%, 80%)'>CC BY-NC 4.0 协议</a> ，转载须注明署名和出处，且不可用于商业用途。`,
    },
    prism: {
      theme: require("prism-react-renderer/themes/github"),
      darkTheme: require("prism-react-renderer/themes/oceanicNext"),
      defaultLanguage: "javascript",
    },
    // googleAnalytics: {
    //   trackingID: "UA-118572241-1",
    //   anonymizeIP: true, // Should IPs be anonymized?
    // },
    gtag: {
      trackingID: "G-6PSESJX0BM",
      // Optional fields.
      anonymizeIP: true, // Should IPs be anonymized?
    },
  },
  presets: [
    [
      "@docusaurus/preset-classic",
      {
        docs: {
          sidebarPath: require.resolve("./sidebars.js"),
          editUrl: "https://gitee.com/etal/blog",
          remarkPlugins: [math],
          rehypePlugins: [katex],
          showLastUpdateTime: true,
        },
        blog: {
          path: "./blog",
          routeBasePath: "/",
          blogSidebarTitle: "近期文章",
          remarkPlugins: [math],
          rehypePlugins: [katex],
          feedOptions: {
            type: "all",
            title: "灵知 全栈工程师",
            copyright: `Copyright © ${new Date().getFullYear()} 灵知 (吴显天) Built with Docusaurus.<p><a href='http://beian.miit.gov.cn/'>京ICP备18036965号</a></p>本站所有内容遵循 <a rel='license' href='https://creativecommons.org/licenses/by-nc/4.0/deed.zh-Hans' style='color: hsl(210deg, 100%, 80%)'>CC BY-NC 4.0 协议</a> ，转载须注明署名和出处，且不可用于商业用途。`,
          },
        },
        theme: {
          customCss: require.resolve("./src/css/custom.css"),
        },
        sitemap: {
          changefreq: "daily",
          priority: 0.5,
        },
      },
    ],
  ],
  // themes: ["@docusaurus/theme-live-codeblock"],
  plugins: [
    "docusaurus2-dotenv",
  ],
  stylesheets: [
    {
      rel: "preconnect",
      href: "https://fonts.gstatic.com",
      type: "text/css",
    },
    {
      href: "/katex/katex.min.css",
      type: "text/css",
      crossorigin: "anonymous",
    },
    {
      href: "https://fonts.font.im/css?family=Raleway:500,700&display=swap",
      type: "text/css",
      rel: "stylesheet",
    },
  ],
  i18n: {
    defaultLocale: "zh-CN",
    locales: ["zh-CN"],
    localeConfigs: {
      "zh-CN": {
        label: "中文",
      }
    },
  },
};
